package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable12;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable12.UserBaseTable12DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable12.vo.*;

/**
 * 企业流水贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable12Mapper extends BaseMapperX<UserBaseTable12DO> {

    default PageResult<UserBaseTable12DO> selectPage(UserBaseTable12PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable12DO>()
                .eqIfPresent(UserBaseTable12DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable12DO::getBusinessLicenseType, reqVO.getBusinessLicenseType())
                .eqIfPresent(UserBaseTable12DO::getRunningWater, reqVO.getRunningWater())
                .eqIfPresent(UserBaseTable12DO::getCreditLiability, reqVO.getCreditLiability())
                .eqIfPresent(UserBaseTable12DO::getIsTollage, reqVO.getIsTollage())
                .eqIfPresent(UserBaseTable12DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable12DO::getIsCar, reqVO.getIsCar())
                .betweenIfPresent(UserBaseTable12DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable12DO::getId));
    }

    default List<UserBaseTable12DO> selectList(UserBaseTable12ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable12DO>()
                .eqIfPresent(UserBaseTable12DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable12DO::getBusinessLicenseType, reqVO.getBusinessLicenseType())
                .eqIfPresent(UserBaseTable12DO::getRunningWater, reqVO.getRunningWater())
                .eqIfPresent(UserBaseTable12DO::getCreditLiability, reqVO.getCreditLiability())
                .eqIfPresent(UserBaseTable12DO::getIsTollage, reqVO.getIsTollage())
                .eqIfPresent(UserBaseTable12DO::getIsHouse, reqVO.getIsHouse())
                .eqIfPresent(UserBaseTable12DO::getIsCar, reqVO.getIsCar())
                .betweenIfPresent(UserBaseTable12DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable12DO::getId));
    }

}
